package rpd.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import rpd.model.TbSchoolStudyInfo;
import rpd.model.TbSchoolStudyInfoExample;
import rpd.model.TbSchoolStudyInfoKey;
import rpd.model.TbSchoolStudyInfoWithBLOBs;

public interface TbSchoolStudyInfoMapper {
    long countByExample(TbSchoolStudyInfoExample example);

    int deleteByExample(TbSchoolStudyInfoExample example);

    @Delete({
        "delete from tb_school_study_info",
        "where id = #{id,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(TbSchoolStudyInfoKey key);

    @Insert({
        "insert into tb_school_study_info (id, start_time, ",
        "end_time, name, user_id, ",
        "resume_id, path)",
        "values (#{id,jdbcType=CHAR}, #{startTime,jdbcType=DATE}, ",
        "#{endTime,jdbcType=DATE}, #{name,jdbcType=CHAR}, #{userId,jdbcType=CHAR}, ",
        "#{resumeId,jdbcType=CHAR}, #{path,jdbcType=LONGVARCHAR})"
    })
    int insert(TbSchoolStudyInfoWithBLOBs record);

    int insertSelective(TbSchoolStudyInfoWithBLOBs record);

    List<TbSchoolStudyInfoWithBLOBs> selectByExampleWithBLOBs(TbSchoolStudyInfoExample example);

    List<TbSchoolStudyInfo> selectByExample(TbSchoolStudyInfoExample example);

    @Select({
        "select",
        "id, start_time, end_time, name, user_id, resume_id, path",
        "from tb_school_study_info",
        "where id = #{id,jdbcType=CHAR}"
    })
    @ResultMap("rpd.mapper.TbSchoolStudyInfoMapper.ResultMapWithBLOBs")
    TbSchoolStudyInfoWithBLOBs selectByPrimaryKey(TbSchoolStudyInfoKey key);

    int updateByExampleSelective(@Param("record") TbSchoolStudyInfoWithBLOBs record, @Param("example") TbSchoolStudyInfoExample example);

    int updateByExampleWithBLOBs(@Param("record") TbSchoolStudyInfoWithBLOBs record, @Param("example") TbSchoolStudyInfoExample example);

    int updateByExample(@Param("record") TbSchoolStudyInfo record, @Param("example") TbSchoolStudyInfoExample example);

    int updateByPrimaryKeySelective(TbSchoolStudyInfoWithBLOBs record);

    @Update({
        "update tb_school_study_info",
        "set start_time = #{startTime,jdbcType=DATE},",
          "end_time = #{endTime,jdbcType=DATE},",
          "name = #{name,jdbcType=CHAR},",
          "user_id = #{userId,jdbcType=CHAR},",
          "resume_id = #{resumeId,jdbcType=CHAR},",
          "path = #{path,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(TbSchoolStudyInfoWithBLOBs record);

    @Update({
        "update tb_school_study_info",
        "set start_time = #{startTime,jdbcType=DATE},",
          "end_time = #{endTime,jdbcType=DATE},",
          "name = #{name,jdbcType=CHAR},",
          "user_id = #{userId,jdbcType=CHAR},",
          "resume_id = #{resumeId,jdbcType=CHAR}",
        "where id = #{id,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(TbSchoolStudyInfo record);
}